package leetcode.code139;

import java.util.List;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public abstract class Solution139 implements IDebug {

	public abstract boolean wordBreak(String s, List<String> wordDict);

	private void debug(String s, String wd, boolean e) {
		List<String> wordDict = HelpDebug.str2liststr(wd);
		boolean r = this.wordBreak(s, wordDict);
		HelpDebug.compare(e, r);
	}


	public void debug1(String s) {
		String wd = "[\"leet\",\"code\",\"leets\",\"sscode\"]";
		boolean e = true;
		debug(s, wd, e);
	}

	@Override
	public void debug2() {
		String s = "applepenapple";
		String wd = "[\"apple\",\"pen\"]";
		boolean e = true;
		debug(s, wd, e);
	}

	@Override
	public void debug3() {
		String s = "catsandog";
		String wd = "[\"cats\",\"dog\",\"sand\",\"and\",\"cat\"]";
		boolean e = false;
		debug(s, wd, e);
	}

	@Override
	public void debug4() {
		String s = "bb";
		String wd = "[\"a\",\"b\",\"bbb\",\"bbbb\"]";
		boolean e = false;
		debug(s, wd, e);
	}

}
